	<form id="form" action="<?php echo site_url(array('perfil', 'modificar'));?>" method="post">
		
		<!-- Datos basicos del usuario -->
		
		<fieldset class="form-fieldset">
			<legend>Datos Personales</legend>
			<table class="form-table">
				<tr>
		   			<td><label for="documento">CI *</label></td>
		    		<td><input id="documento" name="documento" type="number" size="25" maxlength="8" value="<?php echo $usuario['documento']?>" class="validate[required, custom[number], minSize[8]]"></input></td>
				</tr>
		  		<tr>
		   			<td><label for="nombres">Nombre *</label></td>
		   			<td><input name="nombres" type="text" size="25" maxlength="45" value="<?php echo $usuario['nombres']?>" class="validate[required]"></input></td>
				<tr>
		   			<td><label for="apellidos">Apellido *</label></td>
		    		<td><input name="apellidos" type="text" size="25" maxlength="45" value="<?php echo $usuario['apellidos'] ?>" class="validate[required]"></input></td>
				</tr>

				<tr>
		   			<td><label for="email">Email *</label></td>
		    		<td><input name="email" type="text" size="25" maxlength="45" value="<?php echo $usuario['email']?>" class="validate[required,custom[email]]"></input></td>
				</tr>
				<tr>
		   			<td><label for="password">Password *</label></td>
		    		<td><input name="password" type="password" size="25" maxlength="45" value="<?php echo $usuario['password']?>" class="validate[required,minSize[6]]" readonly="readonly"></input></td>
		    		<td> <a id="opener-pass-editor" class="button-editar" href="#">Editar</a></td>
				</tr>
				<tr>
					<td><label for="tipo">Tipo Usuario</label></td>
					<td><input name="tipo" type="text" size="25" maxlength="45"  readonly="readonly" value="<?php echo $usuario['tipo']?>" class="validate[required]"></input></td>
				</tr>								
		   		<tr>
		   			<td><label for="pais_fk">Pais</label></td>
		   			<td>
						<select name="pais_fk" style="width: 200px;">
							<option></option>
							<?php foreach ($paises as $pais):?>
							<option <?php if ($pais['id'] == $usuario['pais_fk']) echo 'selected="selected"';?> value=<?php echo $pais['id'];?>><?php echo $pais['nombre'];?></option>
							<?php endforeach;?>
						</select>
					</td>			    		
				</tr>
		   		<tr>
		   			<td><label for="departamento_fk">Departamento</label></td>
		   			<td>
						<select name="departamento_fk" style="width: 200px;">
							<option></option>
							<?php foreach ($departamentos as $departamento):?>
							<option <?php if ($departamento['id'] == $usuario['departamento_fk']) echo 'selected="selected"';?> value=<?php echo $departamento['id'];?>><?php echo $departamento['nombre'];?></option>
							<?php  endforeach;?>
						</select>
					</td>		    		
				</tr>
		   		<tr>
		   			<td><label for="barrio">Barrio</label></td>
		    		<td><input name="barrio" type="text" size="25" value="<?php echo $usuario['barrio']?>"></input></td>
				</tr>															
		   		<tr>
		   			<td><label for="direccion">Direccion</label></td>
		    		<td><input name="direccion" type="text" size="25" value="<?php echo $usuario['direccion']?>" class="validate[required]"></input></td>
				</tr>
		   		<tr>
		   			<td><label for="celular">Celular / Telefono </label></td>
		    		<td><input name="celular" type="number" size="25" value="<?php echo $usuario['celular']?>" class="validate[required, custom[phone]]"></input></td>
				</tr>					
			</table>
			<input name="coordenadas" type="hidden" value="<?php echo $usuario['coordenadas']?>">
			<table style="float: right;">
				<tr>
					<td><a id="guardar" href="#" class="button-confirmar">Guardar</a></td>
				</tr>			
			</table>
		</fieldset>
		
		<br/>
		
		<!-- Comienza informacion de los contratos del usuario -->
		
		<fieldset class="form-fieldset">
			<legend>Contratos Adquiridos</legend>
				<?php if (empty($contratos)):?>
					<!-- No existen contratos -->
					<p align="center">NO EXISTEN CONTRATOS ADQUIRIDOS.</p>
				<?php else:?>
					
					<!-- listado de los contratos existentes -->
					<?php foreach ($contratos as $contrato):?>
					
					<?php  endforeach;?>
				<?php endif;?> 		
		</fieldset>
	</form>
	
	<script type="text/javascript">
		$('#guardar').click(function(){
			$('#form').submit();
		});
	</script>
	
	<!-- Ediar password popup -->
	<?php include site_path(array('app', 'views', 'pass_editor_popup'), '.php');?>
		
		